﻿using System.Windows;
using System.Windows.Controls;
using Budgetsch.ViewModels.Savings;

namespace Budgetsch.Views.Savings
{
    public partial class SavingDetailView : ChildWindow
    {
        private readonly SavingDetailVMBase m_vm;

        public SavingDetailView(SavingDetailVMBase vm_)
        {
            m_vm = vm_;
            this.DataContext = vm_;
            InitializeComponent();

        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            dfSaving.CommitEdit();
            m_vm.Commit();
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}

